//
//  IFlyDetection.h
//  Learn
//
//  Created by cjg.mini on 2024/4/7.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "TextbookQuestionsModel.h"
@class IFlyDetection;

@protocol IFlyDetectionDelegate<NSObject>
- (void)evaluting:(IFlyDetection*)ifylSpeed result:(NSString*)result;
// 评测错误回调
- (void)onCompleted:(IFlySpeechError *)errorCode;
@end

@interface IFlyDetection : NSObject

/***
 * 读取状态
 */
@property (nonatomic,assign,readonly) BOOL isSpeaking;//defalut = NO

/**
 * delegate
 */
@property (nonatomic,assign) id<IFlyDetectionDelegate> delegate;

/**
 * 开始评测
 */
- (void)startEvalutingWord:(NSString*)word ;

@property (nonatomic, strong)  HSQuestion *question;

/**
 * 取消评测
 */
- (void)cancle ;

/**
 * 停止评测
 */
- (void)stop ;

/**
 * 评测语种
 * language 0:汉语 1 英语
 */
- (void)evalutLanguage:(NSUInteger)language;
/**
 * 评测类型
 * type 0:句子  1:词语   2:篇章
 */
- (void)evalutType:(NSUInteger)type;

/**
 * 评测来源
 * source 0: 麦克风  1:音频流
 */
- (void)evalutSource:(NSUInteger)source;

- (void)xmlDeal:(NSData *)data;
@end
